Skip to content

feat(kubevirt): add pause and unpause actions to vm_lifecycle tool - #1306

Merged
Cali0707 merged 1 commit into
containers:mainfrom
lyarwood:kubevirt-pause
Aug 25, 2026
Merged

feat(kubevirt): add pause and unpause actions to vm_lifecycle tool#1306
Cali0707 merged 1 commit into
containers:mainfrom
lyarwood:kubevirt-pause

Conversation

@lyarwood

@lyarwood lyarwood commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds pause and unpause actions to the vm_lifecycle tool using KubeVirt's subresource API (subresources.kubevirt.io/v1).

With #1361 merged, the AccessControlRoundTripper natively resolves subresources without a Kind field via the discovery client fallback, allowing requests to KubeVirt's subresource endpoints without requiring explicit API group bypass declarations.

Changes

  • Add pause and unpause actions to vm_lifecycle tool
  • Implement PauseVM and UnpauseVM helper functions in pkg/kubevirt using REST calls to the VMI subresource endpoints (/pause and /unpause)
  • Add unit tests for PauseVM, UnpauseVM, and MCP tool invocation error cases
  • Add pause-vm and unpause-vm mcpchecker eval tasks
  • Update tool snapshot and regenerated documentation (README.md and docs/configuration.md)

Related

@github-actions

Copy link
Copy Markdown
Contributor

👋 Heads up — this pull request changes files owned by @ksimon1.

You are listed as an owner of one or more of the changed areas in .github/CODEOWNERS. GitHub cannot auto-request review from owners without write access, so this comment is the notification instead. A review when you have a moment would be appreciated 🙏

Comment thread evals/tasks/kubevirt/unpause-vm/task.yaml Outdated
Comment thread pkg/kubevirt/vm.go
Comment thread pkg/kubevirt/vm.go
Comment thread pkg/kubevirt/vm.go
Comment thread pkg/toolsets/kubevirt/vm/lifecycle/tool.go
Comment thread pkg/kubevirt/vm.go Outdated
Comment thread pkg/kubevirt/vm.go
Comment thread pkg/kubevirt/vm_test.go
Comment thread pkg/kubevirt/vm_test.go
Comment thread pkg/mcp/kubevirt_test.go Outdated
Comment thread pkg/kubevirt/vm.go
Comment thread pkg/kubevirt/vm.go
The vm_lifecycle tool only supported start, stop, and restart actions.
This meant AI agents could not pause/unpause VMs, causing them to fall
back to stopping VMs instead (which is a fundamentally different
operation). Add pause and unpause actions that use the KubeVirt
subresource API (subresources.kubevirt.io/v1) to suspend and resume
running VMIs in-place.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
@lyarwood

Copy link
Copy Markdown
Contributor Author

@Cali0707 thanks for the review again, hopefully everything is addressed now.

@ksimon1

ksimon1 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@2uasimojo 2uasimojo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cali0707
Cali0707 merged commit db50ee5 into containers:main Aug 25, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(kubevirt): add pause/unpause support to vm_lifecycle tool

5 participants